package thread;

/**
 * 多线程常用方法
 * @author yuisama
 * @date 2022/06/16 21:06
 **/
public class NormalMethod {
    public static void main(String[] args) {
        // 一般搭配子类使用，需要有一个继承了Thread类的子类
        Thread t1 = new Thread();
        Thread t2 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("传入Runnable对象");
            }
        });
        Thread t3 = new Thread("鹏哥线程");
        Thread t4 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("hehe");
            }
        },"铭哥线程");
    }
}